home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 401-425 / disk_415 / uedit / config!s < prev    next >
Text File  |  1992-05-06  |  10KB  |  365 lines

  1. ======== SPELLING CMDS ======
  2.  
  3. Start spell-checking mode by loading in the dictionary table.
  4. <rAmiga-u:  if (spellerUp)
  5.                 putMsg("Speller is up")
  6.             else if (startSpell("Udtable","Udict",1))
  7.                 putMsg("Speller is up")
  8.             else if (startSpell("s:Udtable","s:Udict",1)) .. K. Perano
  9.                  putMsg("Speller is up")
  10.             else if (startSpell("u:Udtable","u:Udict",1)) .. K. Perano
  11.                 putMsg("Speller is up")
  12.             else {
  13.                 putMsg("No memory or dictionary not found")
  14.                 returnFalse
  15.             } >
  16.  
  17. Find first misspelled word, starting at cursor.  Abort with Amiga-ESC.
  18. <rAmiga-c:
  19.     if (not spellerUp) {
  20.         putMsg("Speller not up")
  21.         returnFalse
  22.     }
  23.     putMsg(" ")
  24.     while (not spell(buf54,curFile,buf41)) runKey(virtual-z) >
  25.  
  26. Click word in msg line (buf54), select word to replace word before cursor.
  27. <virtual-z:
  28.     if (isEmpty(buf54)) return
  29.     insertRgn(buf54,efile," ***",all)
  30.     putMsg(buf54)
  31.     vscroll(atCursor)
  32.     updateDisplay
  33.     getKeyVal(n3,n4)
  34.     if (eqNum(n3,normal-esc)) abort
  35.     mousexy(n1,n2)
  36.     while (inputKey(n54)) nothing
  37.     if (mouseDown) while (not inputWaiting) {
  38.         if (not mouseDown) goto label(0)
  39.         inputKey(n54)
  40.     }
  41.     label(0)
  42.     if (geNum(n3,normal-gadget1) & geNum(normal-gadget4,n3)
  43.                                  & gtNum(n2,10) & gtNum(20,n2)) {
  44.         div(n1,n1,8)
  45.         incNum(n1)
  46.         moveCursor(buf54,sfile)
  47.         moveCursor(buf54,eword)
  48.         locToIndex(buf54,n54,atcursor)
  49.         if (gtNum(n1,n54)) {
  50.             indexToLoc(buf54,atCursor,n1)
  51.             if (is(buf54,alpha)) {
  52.                 movecursor(buf54,eword)
  53.                 movecursor(buf54,sword)
  54.                 movecursor(curfile,sword)
  55.                 if (is(curfile,upperCase)) toUpper(buf54)
  56.                 clearRgn(curfile,word)
  57.                 insertrgn(curfile,atcursor,buf54,word)
  58.                 updateDisplay
  59.             }
  60.         }
  61.     }
  62.     putMsg(" ")
  63.     freeBuf(buf54)
  64.     while (inputKey(n54)) nothing
  65.     if (mouseDown) while (not inputWaiting) {
  66.         if (not mouseDown) return
  67.         inputKey(n54)
  68.     }
  69. >
  70.  
  71. Spell-check from cursor fwd.  Mark bad words with "@".
  72. <rAmiga-m:
  73.     if (not runKey(rAmiga-u)) returnFalse
  74.     putMsg("Spell checking ... abort with Amiga-ESC")
  75.     while (not spell(" ",curFile,buf41)) insertChar(curFile,"@") >
  76.  
  77. Force file saving to finish so buffer is unlocked
  78. <104: while (getStackSize(n99,n99,n98) & gtNum(n98,0)) delay(5) >
  79.  
  80. Load supplemental dictionary & spell from cursor fwd.  Add to supplement.
  81. <rAmiga-l:
  82.     if (not runKey(rAmiga-u)) returnFalse
  83.     equateNum(n54,curFile)
  84.     putMsg("Dict supplement to use (pmESC = UdSupplement)")
  85.     freebuf(buf54)
  86.     equateNum(n99,0)
  87.     if (inputString(buf54))  {
  88.        if (not loadFile(buf54)) goto label(3)
  89.     } else {
  90. label(3)
  91.         if (not loadFile("UdSupplement")) {
  92.             if (not newFile) {
  93.                 putMsg("Close a file for me!")
  94.                 returnFalse
  95.             }
  96.             setFileName(curfile,"UdSupplement")
  97.         }
  98.     }
  99.     putMsg("Spell checking ... abort with Amiga-ESC")
  100.     if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  101. label(0)
  102.     while (not spell(" ",buf[n54],curFile)) {
  103.         moveCursor(buf[n54],sWord)
  104.         freeBuf(buf54)
  105.         insertRgn(buf54,eFile,buf[n54],word)
  106.         moveCursor(buf[n54],eWord)
  107.         moveCursor(buf54,sFile)
  108.         if (not is(buf54,"'") & not is(buf54,alpha)) goto label(0)
  109.         moveCursor(buf54,eFile)
  110.         putMsg(buf54)                               .. remove for faster speed
  111.  
  112.         ..  this sect for speed
  113.         moveCursor(buf54,sFile)
  114.         copyChar(buf54,n47)                          .. copy 1st char of word
  115.         freeBuf(buf52)
  116.         insertChar(buf52,eLine)                      .. load in eline-1stchar
  117.         insertChar(buf52,n47)
  118.         moveCursor(curFile,eFile)                 .. search for starting place
  119.         setSearch(buf52)
  120.         search(curfile,locA,locB,-1)
  121.         moveCursor(curFile,eWord)                  .. move fwd, so sWord works
  122.         if (is(curFile,sFile)) goto label(1)
  123.         while (nothing) {
  124.             moveCursor(curFile,sWord)
  125.             freeBuf(buf53)
  126.             insertRgn(buf53,eFile,curFile,word)
  127.             stringComp(n53,buf54,buf53,1)                       .. ignore case
  128.             if (eqNum(n53,0)) goto label(0)             .. found it, continue
  129.             if (gtNum(n53,0)) {
  130.  label(1)
  131.                 moveCursor(curFile,eWord)
  132.                 moveCursor(curFile,eChar)
  133.  label(2)
  134.                 insertRgn(curFile,atCursor,buf54,all)
  135.                 insertChar(curFile,eLine)
  136.                 updateDisplay                       .. remove for faster speed
  137.                 incNum(n99)
  138.                 if (gtNum(n99,19)) {
  139.                     fileSize(curFile,n99)              .. force buffer packing
  140.                     equateNum(n99,0)
  141.                 }
  142.                 goto label(0)
  143.             }
  144.             if (is(curFile,sFile)) goto label(2)
  145.         }
  146.     }
  147.     moveCursor(curFile,sFile)
  148.     putMsg("These words weren't in dictionary")
  149.     .. stopSpell                               .. use if want speller removed
  150.     >
  151.  
  152. Merge dict supplement with dict-files.  dict.A-Z must be in Current Directory.
  153. <rAmiga-d:
  154.     if (isEmpty(curFile)) returnFalse
  155.     moveCursor(curFile,sFile)
  156.     freeBuf(buf52)
  157.     freeBuf(buf54)
  158.     insertRgn(buf54,eFile,"S:dict. ",all)
  159.     if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  160.     equateNum(n50,0)
  161.     while (nothing) {
  162.         moveCursor(curFile,eWord)
  163.         moveCursor(curFile,sWord)
  164.         freeBuf(buf53)
  165.         if (not insertRgn(buf53,eFile,curFile,word)) {
  166. label(6)    if (getFlag(buf52,changed)) saveFile(buf52)
  167.             runKey(104)                             .. force save to complete
  168.             goto label(0)
  169.         }
  170.         moveCursor(buf53,sFile)
  171.         toUpper(buf53)
  172.         copyChar(buf53,n54)                    .. copy 1st letter of word A-Z
  173.         toLower(buf53)
  174.         if (eqNum(n54,39)) equateNum(n54,65)             .. apost becomes 'A'
  175.         else {
  176.             if (gtNum(n54,90)) goto label(1)                   .. must be A-Z
  177.             if (gtNum(65,n54)) goto label(1)
  178.         }
  179.         moveCursor(buf54,eFile)
  180.         moveCursor(buf54,sChar)
  181.         swapChar(buf54,n54)                          .. make it "dict.A" etc.
  182.  
  183.         if (not eqNum(n54,n50)) {
  184.             if (not eqNum(n50,0)
  185.                 & getFlag(buf52,changed)) saveFile(buf52)
  186.             runKey(104)                             .. force save to complete
  187.             clearRgn(buf52,all)
  188.             fileSize(buf52,n49)                        .. make it pack buffer
  189.             if (not insertFile(buf52,eFile,buf54)) {
  190.                 putMsg("Can't find dict.A-Z!")
  191.                 returnFalse
  192.             }
  193.             setFileName(buf52,buf54)
  194.             if (getFlag(buf52,changed)) flipFlag(buf52,changed)
  195.             equateNum(n50,n54)                            .. save dict-letter
  196.         }
  197.         .. put word in dict.
  198.         moveCursor(buf53,eFile)
  199.         putMsg(buf53)
  200.         insertChar(buf53,eLine)
  201.         moveCursor(buf52,eFile)
  202. label(2)
  203.         setSearch(buf53)
  204.         if (search(buf52,locA,locB,-1)) {
  205.             if (is(buf52,sWord)) goto label(1)
  206.             goto label(2)                                .. continue searching
  207.         }
  208.         .. didn't find it.  Do the slow scan & insert the word.
  209.         moveCursor(buf53,eFile)
  210.         moveCursor(buf53,sChar)
  211.         clearChar(buf53)                                      .. remove eLine
  212.         moveCursor(buf52,eFile)
  213.         equateNum(n49,1)
  214. label(4)
  215.         while (nothing) {
  216.             if (eqNum(n49,1)) do(n48,1,40) moveCursor(buf52,sWord)
  217.             moveCursor(buf52,sWord)
  218.             freeBuf(buf51)
  219.             insertRgn(buf51,eFile,buf52,word)
  220.             stringComp(n53,buf53,buf51,1)                       .. ignore case
  221.             if (eqNum(n53,0)) goto label(1)             .. found it, continue
  222.             if (gtNum(n53,0)) {
  223.                 if (eqNum(n49,1)) goto label(5)
  224.                 moveCursor(buf52,eWord)
  225.                 moveCursor(buf52,eChar)
  226. label(3)
  227.                 insertRgn(buf52,atCursor,buf53,all)
  228.                 insertChar(buf52,eLine)
  229.                 goto label(1)
  230.             }
  231.             if (is(buf52,sFile)) {
  232.                 if (eqNum(n49,1)) {
  233. label(5)
  234.                     equateNum(n49,0)
  235.                     do (n48,1,41) moveCursor(buf52,eWord)
  236.                     goto label(4)
  237.                 }
  238.                 goto label(3)
  239.             }
  240.         }
  241.  
  242. label(1) .. next word
  243.         moveCursor(curFile,eLine)
  244.         moveCursor(curFile,eChar)
  245.         updateDisplay
  246.         if (is(curFile,eFile)) goto label(6)
  247.     }
  248. label(0)
  249.     putMsg("Done.  Run Udbuild to rebuild working dict & table")
  250.     freeBuf(buf52)
  251. >
  252.  
  253. Remove words from dict-files.  dict.A-Z must be in Current Directory.
  254. <rAmiga-e:
  255.     if (isEmpty(curFile)) returnFalse
  256.     moveCursor(curFile,sFile)
  257.     freeBuf(buf52)
  258.     freeBuf(buf54)
  259.     insertRgn(buf54,eFile,"S:dict. ",all)
  260.     if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  261.     equateNum(n50,0)
  262.     while (nothing) {
  263.         moveCursor(curFile,eWord)
  264.         moveCursor(curFile,sWord)
  265.         freeBuf(buf53)
  266.         if (not insertRgn(buf53,eFile,curFile,word)) {
  267. label(6)
  268.                 if (getFlag(buf52,changed)) saveFile(buf52)
  269.                 runKey(104)                         .. force save to complete
  270.                 goto label(0)
  271.         }
  272.         moveCursor(buf53,sFile)
  273.         toUpper(buf53)
  274.         copyChar(buf53,n54)                    .. copy 1st letter of word A-Z
  275.         toLower(buf53)
  276.         if (eqNum(n54,"'")) equateNum(n54,"A")           .. apost becomes 'A'
  277.         else {
  278.             if (gtNum(n54,"Z")) goto label(1)                   .. must be A-Z
  279.             if (gtNum(65,n54)) goto label(1)
  280.         }
  281.         moveCursor(buf54,eFile)
  282.         moveCursor(buf54,sChar)
  283.         swapChar(buf54,n54)                          .. make it "dict.A" etc.
  284.  
  285.         if (not eqNum(n54,n50)) {
  286.             if (not eqNum(n50,0) & getFlag(buf52,changed)) saveFile(buf52)
  287.             runKey(104)                             .. force save to complete
  288.             clearRgn(buf52,all)
  289.             fileSize(buf52,n49)                        .. make it pack buffer
  290.             if (not insertFile(buf52,eFile,buf54)) {
  291.                 putMsg("Can't find dict.A-Z!")
  292.                 returnFalse
  293.             }
  294.             setFileName(buf52,buf54)
  295.             if (getFlag(buf52,changed)) flipFlag(buf52,changed)
  296.             equateNum(n50,n54)                            .. save dict-letter
  297.         }
  298.         .. remove word from dict.
  299.         moveCursor(buf53,eFile)
  300.         putMsg(buf53)
  301.         insertChar(buf53,eLine)
  302.         moveCursor(buf52,eFile)
  303. label(2)
  304.         setSearch(buf53)
  305.         if (search(buf52,locA,locB,-1)) {
  306.             if (is(buf52,sWord)) {
  307.                 clearRgn(buf52,loc)
  308.                 goto label(1)                                     .. next word
  309.             }
  310.             goto label(2)                                .. continue searching
  311.         }
  312.  
  313. label(1) .. next word
  314.         moveCursor(curFile,eLine)
  315.         moveCursor(curFile,eChar)
  316.         if (is(curFile,eFile)) goto label(6)
  317.         updateDisplay
  318.     }
  319. label(0)
  320.     putMsg("Done.  Run Udbuild to rebuild working dict & table")
  321.     freeBuf(buf52)
  322. >
  323.  
  324. Stop spell-checking mode.  (Frees up about 12k of memory.)
  325. <rAmiga-f: if (spellerUp) { stopSpell putMsg("Speller removed") } >
  326.  
  327. ========== Split Windows =========
  328.  
  329. Remove current split window
  330. <lAmiga-0: splitWindow(curFile,0)>
  331.  
  332. Split window to show current file
  333. <lAmiga-c: splitWindow(curFile,splitSize)>
  334.  
  335. Split window to show Undo buffer
  336. <lAmiga-1: splitWindow(buf45,splitSize)>
  337.  
  338. Split window to show search buffer
  339. <lAmiga-2: splitWindow(buf49,splitSize)>
  340.  
  341. Split window to show replace buffer
  342. <lAmiga-3: splitWindow(buf48,splitSize)>
  343.  
  344. Split window to show copied-hilite buffer
  345. <lAmiga-4: splitWindow(buf47,splitSize)>
  346.  
  347. Split window to show copied-invert buffer
  348. <lAmiga-5: splitWindow(buf46,splitSize)>
  349.  
  350. Split window to show copied-columnar buffer
  351. <lAmiga-6: splitWindow(buf37,splitSize)>
  352.  
  353. Split window to show directory names
  354. <lAmiga-7: splitWindow(buf38,splitSize) >
  355.  
  356. Set split window size
  357. <lAmiga-8:
  358.     putMsg("# lines in split window (2 or more):")
  359.     if (inputNum(n54) & geNum(n54,2)) equateNum(splitSize,n54)
  360.     putMsg(" ")>
  361.  
  362. Switch to next window split
  363. <lAmiga-9: toggle(windowSplit)>
  364.  
  365.